#include<stdio.h>

int main()
{
    int n, g, m, x, flag = 0;
    scanf("%d", &n);
    
    for(g = 0; g <= n / 5; g ++)
    {
        for(m = 0; m <= n / 3; m ++)
        {
            x = n - g - m;
            if(m == (n - g * 7) / 4 && x >= 0 && x <= n * 3)
            {
                printf("%4d%4d%4d\n", g, m, x);
                flag = 1;
            }
        }
    }
    if(flag == 0)
        printf("No Answer");

    return 0;
}